//package com.glsc.ngateway.flowable.listener.global;
//
//import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
//import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
//import org.flowable.engine.RuntimeService;
//import org.flowable.spring.SpringProcessEngineConfiguration;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.ApplicationListener;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.DependsOn;
//import org.springframework.context.event.ContextRefreshedEvent;
//
//@Configuration
//@DependsOn("processStartListener")
//public class GlobalListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
//    private static Logger logger = LoggerFactory.getLogger(GlobalListenerConfig.class);
//
//    @Autowired
//    private SpringProcessEngineConfiguration configuration;
//    @Autowired
//    private RuntimeService runtimeService;
//    @Autowired
//    private ProcessCompleteListener processCompleteListener;
//    @Autowired
//    private TaskCreateListener taskCreateListener;
//
////    @Autowired
////    private ProcessStartListener processStartListener;
//
//
//    @Override
//    public void onApplicationEvent(ContextRefreshedEvent event) {
//        FlowableEventDispatcher dispatcher = configuration.getEventDispatcher();
//
//        logger.info("addEventListener 初始化1111");
//
//        //任务完成全局监听
//        //dispatcher.addEventListener(activityCompleteListener, FlowableEngineEventType.TASK_CREATED);
//        runtimeService.addEventListener(taskCreateListener, FlowableEngineEventType.TASK_CREATED);
//        runtimeService.addEventListener(processCompleteListener, FlowableEngineEventType.PROCESS_COMPLETED);
////        runtimeService.addEventListener(processStartListener, FlowableEngineEventType.PROCESS_STARTED);
////        logger.info("addEventListener 初始化.....processStartListener="+processStartListener);
//    }
//}